home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Disks.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  3.0 KB  |  118 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Disks.p
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1991,1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Disks;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DISKS__}
  28. {$SETC __DISKS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DisksIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __OSUTILS__}
  38. {$I OSUtils.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. CONST
  48.     sony                        = 0;
  49.     hard20                        = 1;
  50.  
  51. {
  52.     Note:
  53.     
  54.     qLink is usually the first field in queues, but back in the MacPlus
  55.     days, the DrvSts record needed to be expanded.  In order to do this without
  56.     breaking disk drivers that already added stuff to the end, the fields 
  57.     where added to the beginning.  This was originally done in assembly language
  58.     and the record was defined to start at a negative offset, so that the qLink
  59.     field would end up at offset zero.  When the C and pascal interfaces where
  60.     made, they could not support negative record offsets, so qLink was no longer
  61.     the first field.  Universal Interfaces are auto generated and don't support
  62.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a 
  63.     none zero offset.  Assembly code which switches to Universal Interfaces will
  64.     need to compensate for that.
  65.  
  66. }
  67.  
  68.  
  69. TYPE
  70.     DrvStsPtr = ^DrvSts;
  71.     DrvSts = RECORD
  72.         track:                    INTEGER;                                {  current track  }
  73.         writeProt:                SignedByte;                                {  bit 7 = 1 if volume is locked  }
  74.         diskInPlace:            SignedByte;                                {  disk in drive  }
  75.         installed:                SignedByte;                                {  drive installed  }
  76.         sides:                    SignedByte;                                {  -1 for 2-sided, 0 for 1-sided  }
  77.         qLink:                    QElemPtr;                                {  next queue entry  }
  78.         qType:                    INTEGER;                                {  1 for HD20  }
  79.         dQDrive:                INTEGER;                                {  drive number  }
  80.         dQRefNum:                INTEGER;                                {  driver reference number  }
  81.         dQFSID:                    INTEGER;                                {  file system ID  }
  82.         CASE INTEGER OF
  83.         0: (
  84.             twoSideFmt:            SignedByte;                                {  after 1st rd/wrt: 0=1 side, -1=2 side  }
  85.             needsFlush:            SignedByte;                                {  -1 for MacPlus drive  }
  86.             diskErrs:            INTEGER;                                {  soft error count  }
  87.            );
  88.         1: (
  89.             driveSize:            INTEGER;
  90.             driveS1:            INTEGER;
  91.             driveType:            INTEGER;
  92.             driveManf:            INTEGER;
  93.             driveChar:            INTEGER;
  94.             driveMisc:            SignedByte;
  95.            );
  96.     END;
  97.  
  98.     DrvSts2                                = DrvSts;
  99.     DrvSts2Ptr                             = ^DrvSts2;
  100.  
  101. CONST
  102.     kdqManualEjectBit            = 5;
  103.  
  104. FUNCTION DiskEject(drvNum: INTEGER): OSErr;
  105. FUNCTION SetTagBuffer(buffPtr: UNIV Ptr): OSErr;
  106. FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr;
  107.  
  108. {$ALIGN RESET}
  109. {$POP}
  110.  
  111. {$SETC UsingIncludes := DisksIncludes}
  112.  
  113. {$ENDC} {__DISKS__}
  114.  
  115. {$IFC NOT UsingIncludes}
  116.  END.
  117. {$ENDC}
  118.